HashTreeModel

open class HashTreeModel<T> : TreeModel

A HashTreeModel is an implementation of the Swing TreeModel backed by a HashMap. Any objects can be added as nodes or the class can be parameterized so that only nodes belonging to some type may be added (noting that TreeModel methods will still use Object). An object may only be inserted into the tree once as enforced by equals as this causes problems with the JTree.

Author

Jay Detwiler

Constructors

Link copied to clipboard
constructor(root: T)
Create the HashTreeModel with the given object as root.

Properties

Link copied to clipboard
open val root: T

Functions

Link copied to clipboard
open fun addChild(parent: T, child: T)
Add a node to a parent.
Link copied to clipboard
Link copied to clipboard
open fun getChild(parent: Any, index: Int): T
Link copied to clipboard
open fun getChildCount(parent: Any): Int
Link copied to clipboard
open fun getIndexOfChild(parent: Any, child: Any): Int
Link copied to clipboard
abstract fun getRoot(): Any
Link copied to clipboard
open fun isLeaf(node: Any): Boolean
Link copied to clipboard
open fun isMember(node: Any): Boolean
Return true if the given node is a member of the tree.
Link copied to clipboard
open fun removeChildren(node: T)
Link copied to clipboard
open fun removeNode(node: T)
Remove a node from the tree.
Link copied to clipboard
Link copied to clipboard
open fun valueForPathChanged(path: TreePath, newValue: Any)